<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FSF.atoi</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>atoi</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">FarStandardFunctions</a>
</div>

<div class=shortdescr>
The <dfn>FSF.atoi</dfn> function converts a string to a 32-bit integer.
</div>

<pre class=syntax>
int WINAPI atoi(
  const char *Str
);
</pre>

<h3>Parameters</h3>
<div class=descr>
  <div class=dfn>Str</div>
  <div class=dfndescr>Points to a string to convert.
  </div>
</div>

<h3>Return value</h3>
<div class=descr>
If the function succeeds, return value is the converted value of the input string <em>Str</em>, otherwise it returns 0.
</div>

<h3>Remarks</h3>
<div class=descr>
The <em>Str</em> string parameter must be in the following form:<br>
<code>[ws][sn][ddd]</code>
where<br>
&nbsp;&nbsp;ws - space or tab characters (ignored)<br>
&nbsp;&nbsp;sn - sign - '+' or '-'<br>
&nbsp;&nbsp;ddd - one or more decimal digits - from '0' to '9'<br>

The function stops reading the input string at the first character that it cannot recognize as part of a number.
In case of overflow the return value is undefined.
</div>

<h3>Example</h3>
<div class=descr>
You can define and initialize a function pointer to use it later:
<pre class=code>
FARSTDATOI FarAtoi;
...
FarAtoi=Info.FSF-&gt;atoi;
...
I=FarAtoi(Str);
</pre>
...or call the function directly:
<pre class=code>
I=Info.FSF-&gt;atoi(Str);
</pre>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="atoi64.html">FSF.atoi64</a> |
<a href="itoa.html">FSF.itoa</a> |
<a href="itoa64.html">FSF.itoa64</a>
</div>

</body>
</html>
